﻿<?php
error_reporting(0);
define('IN_QY',true);
session_start();
require("include/common.inc.php");
require_once "saoyisao/jssdk.php";
$jssdk = new JSSDK("wxd6671ed64906b4b4", "04b2aa5188bde40a5adecb5fbaea226a");
$signPackage = $jssdk->GetSignPackage();
define('SCRIPT','ad_list');
?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>众晒网</title>
    <link href="/ui/css/Hui.css" rel="stylesheet" type="text/css" />
    <link href="style1.css" rel="stylesheet" type="text/css"/>	
    <link href="/ui/plugins/swiper/swiper.min.css" rel="stylesheet" />	
    <style type="text/css">
        #header{width:100%; position:absolute; top:0;}
        #footer{width:100%; position:absolute; bottom:0;}
        #main{width:100%; overflow: auto; position:absolute; top:44px;bottom:55px;background:white;}
        .aui-list-well{background-position:0px -50px;}
    </style>
</head>
<body>
   <!--################### 华丽的分割线 ###################-->
    <header class="H-header H-theme-background-color8" id="header">
        <div class="H-header-title H-flexbox-horizontal H-vertical-middle H-font-size-18 H-text-show-row-1 H-theme-font-color-white H-position-absolute H-width-100-percent" style="background:#f26c27">
		
							 <?php
		 
		 // 是否微信中打开
function is_weixin() {
   if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
       return true;
    } return false;
 }
 $is_weixin = (is_weixin() == true) ? "1" : "2";	
 ?>	
  <?php
 if($is_weixin==1){
	 	?> 
		
            <span id="scanQRCode" class="H-icon H-position-relative H-display-inline-block H-vertical-middle H-theme-font-color-white H-padding-horizontal-left-5 H-z-index-100">
			 <span class="H-icon"><i class="H-padding-horizontal-left-5 H-top--550 H-iconfont H-icon-saoma
                 H-font-size-24 H-vertical-middle"></i></span>
				 
			</span>
	
  <?php } ?>

 <?php
 if($is_weixin==2){
	?> 
            <span tapmode="" onclick="H.openWin('myfenlei', 'myfenlei.php');" class="H-icon H-position-relative H-display-inline-block H-vertical-middle H-theme-font-color-white H-padding-horizontal-left-5 H-z-index-100">
			 <span class="H-icon"><i class="H-padding-horizontal-left-5 H-top--550 H-iconfont H-icon-more-menu
                 H-font-size-18 H-vertical-middle"></i></span>
			</span>
	
	
	

	 <?php } ?>	
			      
            <div tapmode="" onclick="H.openWin('mysearch', 'mysearch.php');" class="H-header-search H-flex-item H-margin-horizontal-both-10 H-padding-horizontal-both-10 H-position-relative H-theme-background-color8-active H-border-radius-15 H-line-height-normal" style="background:#f3a568">
                <span class="H-icon H-display-block H-position-absolute H-float-left H-z-index-10 H-vertical-middle" style="height: 100% !important;">
				<i class="H-iconfont H-icon-search H-font-size-16"></i>
				</span>
			
                <input type="text"  name="title" placeholder="请输入关键字" id="H-header-search-text" class="H-width-100-percent H-box-sizing-border-box H-border-none H-padding-horizontal-both-10 H-font-size-14 H-padding-vertical-both-8 H-theme-background-color-transparent H-theme-font-color-white H-padding-horizontal-left-25 H-vertical-middle" />  
				
            </div>
              	
            <span tapmode="" onclick="H.openWin('checkcity', 'checkcity.html');" class="H-icon H-position-relative H-display-inline-block H-vertical-middle H-theme-font-color-white H-padding-horizontal-right-15 H-z-index-100"><i class="H-iconfont H-icon-where H-font-size-18 H-vertical-middle"></i>
			  <label class="H-padding-horizontal-left-5 H-font-size-11">
           <?php if($_GET['city']==""){ ?>
             全国	
		<?php }  ?>
			 <?=$_GET['city']?>
			  </label>
</span>
        </div> 
    </header>    
	<div id="main">  
      <!--轮播-->
  <div class="H-swiper H-position-relative H-width-100-percent H-box-sizing-border-box H-overflow-scrolling" style="height:150px;">
        <div class="swiper-normal  H-position-absolute H-width-100-percent H-height-100-percent">
        <div class="swiper-wrapper">			
	   <?
	   
	   if($_GET['city']==""){  
		$luncity='全国的';   
	   }else{
		$luncity= $_GET['city'];  
		   
	   }
	   
		$sql = "select * from tbl_xcxban where city='".$luncity."'  ORDER by id DESC ";
	    $query=mysql_query($sql);
		while($row=mysql_fetch_array($query))
	{	
	?>		
	<div onclick="H.openWin('main', '<?=$row['wap']?>');"  class="swiper-slide"><img src="<?=$row['imgurl']?>" class="H-width-100-percent H-height-100-percent" /></div>	
    <?php } ?>	
            </div>
        </div>
    </div>	 
	<!--轮播-->	
	
    <!--四个按钮-->		
	    <div class="H-flexbox-horizontal H-text-align-center H-theme-background-color-white H-padding-vertical-both-10" style="height:67px">
        <div class="H-flex-item" onclick="H.openWin('haigou', '/haigou/');" style="height:30px">
        <div class="swiper-slide"><img src="/ui/image/安心海go.png" style="height:37px;width:37px;" class="H-width-100-percent H-height-100-percent" /></div>
		<label class="H-display-block H-font-size-13 H-margin-vertical-top-8">安心·海Go</label>
        </div>
		
        <div class="H-flex-item" onclick="H.openWin('muying', 'muying.php');" style="height:30px">
        <div class="swiper-slide"><img src="/ui/image/母婴商城.png" style="height:37px;width:37px;" class="H-width-100-percent H-height-100-percent" /></div>
		 <label class="H-display-block H-font-size-13 H-margin-vertical-top-8">母婴商城</label>
        </div>
		
        <div class="H-flex-item" onclick="H.openWin('myfenlei', 'myfenlei.php');" style="height:30px">
        <div class="swiper-slide"><img src="/ui/image/母婴分类.png" style="height:37px;width:37px;" class="H-width-100-percent H-height-100-percent" /></div>
	   <label class="H-display-block H-font-size-13 H-margin-vertical-top-8">母婴分类</label>			
        </div>
		
        <div class="H-flex-item" onclick="H.openWin('huodong', 'huodong.php');" style="height:30px">
        <div class="swiper-slide"><img src="/ui/image/众晒活动.png" style="height:37px;width:37px;" class="H-width-100-percent H-height-100-percent" /></div>
	   <label class="H-display-block H-font-size-13 H-margin-vertical-top-8">众晒活动</label>			
        </div>		
	
    </div>	
		
    <!--四个按钮-->
	    <div class="H-padding-vertical-bottom-8"></div>
    <!--三张图-->
	
         <div class="H-theme-background-color-white H-clear-both H-width-100-percent H-display-table H-box-sizing-border-box H-padding-horizontal-left-2" onclick="OpenBbs(1);">
                <div tapmode="" onclick="H.openWin('mysearch', 'mysearch.php?s=宝宝洗护');"  class="H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-3 H-padding-horizontal-right-2 H-margin-vertical-bottom-2">
                    <img src="/ui/image/宝宝洗护@3x.png" class="H-width-100-percent  H-display-block" alt="" title="" />
                </div>
                <div tapmode="" onclick="H.openWin('/haigou/', '/haigou/');" class="H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-3 H-padding-horizontal-right-2 H-margin-vertical-bottom-2">
                    <img src="/ui/image/海外直购@3x.png" class="H-width-100-percent H-display-block" alt="" title="" />
                </div>
                <div tapmode="" onclick="H.openWin('mysearch', 'mysearch.php?s=童装玩具');" class="H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-3 H-padding-horizontal-right-2 H-margin-vertical-bottom-2">
                    <img src="/ui/image/童装玩具@3x.png" class="H-width-100-percent  H-display-block" alt="" title="" />
                </div>
        </div>
		
    <!--三张图-->
	
    <!-- 闲置交易-->	
	    <div class="H-n-grid H-clear-both">
        <div class="H-clear-both H-width-100-percent H-display-table H-box-sizing-border-box H-border-vertical-top-after H-border-vertical-bottom-after H-padding-vertical-both-5 H-theme-background-color-white">
		
            <div tapmode="" onclick="H.openWin('xianzhi', 'xianzhi.php');" class="H-display-table-cell H-float-left H-box-sizing-border-box H-border-horizontal-right-after H-width-avg-2 H-border-vertical-bottom-after H-center-all H-theme-background-color-white" style="min-height: 70px;">
			
                <div class="H-margin-horizontal-left-0" style="width: 100%; height: 100%; ">
                    <img src="/ui/image/闲置专区@3x.png" class="H-display-block  H-border-both H-width-100-percent H-height-100-percent" />
                </div>
				
            </div>
			
            <div tapmode="" onclick="H.openWin('jineng', 'jineng.php');" class="H-display-table-cell H-float-left H-box-sizing-border-box H-width-avg-2 H-center-all  H-theme-background-color-white H-border-vertical-bottom-after" style="min-height: 70px;">
			
                <div    class="H-margin-horizontal-left-0" style="width: 100%; height: 100%; ">
                    <img src="/ui/image/技能专区@3x.png" class="H-display-block  H-border-both H-width-100-percent H-height-100-percent" />
                </div>

            </div>
			
        </div>
    </div>
    <!--闲置交易-->
	<!-- 蜜圈开始 -->
	
                <div tapmode="" onclick="H.openWin('miquan', 'miquan.php');" class="aui-flex b-line">
                    <div class="aui-flex-box">蜜圈</div>
                </div>
				
					<?
					
	if($_GET['city']==""){
	$reslut = "select count(*) as a from tbl_mother_article where  status=0 ";		
		
	}	else {
		
	$reslut = "select count(*) as a from tbl_mother_article where  status=0  and city='".$_GET['city']."'";	
	}			
	
$query_reslut = mysql_query($reslut);
$row_reslut=mysql_fetch_array($query_reslut);
$count=$row_reslut['a'];
//页面数量
$page_size=10;
//总页数
$page_count = ceil($count/$page_size);
//第几页
$page=$_GET['page'];
if($page==''){
  $page=1;
}
$last=$page-1;//上一页
$next=$page+1;//下一页

//页面起始条数
$offset=$page_size*($page-1);
	  		    	
		if($_GET['city']==""){
	$sql = "select * from tbl_mother_article where  status=0 ";		
		
	}	else {
		
	$sql = "select * from tbl_mother_article where  status=0  and city='".$_GET['city']."' ORDER by id DESC LIMIT $offset,$page_size";	
	}
	
	
	
	$query=mysql_query($sql);
							if(!mysql_affected_rows()){
            echo '
			    <div class="H-padding-vertical-bottom-10"></div>
				
    <div class="H-channel-title H-flexbox-horizontal H-theme-background-color-white H-vertical-middle H-border-vertical-bottom-after">
        <div class="H-channel-line H-theme-background-color8 H-padding-vertical-top-15 H-padding-horizontal-left-3  H-margin-horizontal-left-10"></div>
        <div class="H-channel-text H-theme-font-color8 H-flex-item H-font-size-18 H-theme-font-color-black H-padding-10 H-margin-horizontal-right-10 H-text-show-row-1">暂无商品</div>
    </div>
	</br></br>
			';
}

	while($row=mysql_fetch_array($query))
	{	
	?>
						     <?php
					    $sqluyo = "SELECT * from tbl_user  where id='".$row['uid']."' ";
                        $queryuyo=mysql_query($sqluyo);
                        $rowuyo=mysql_fetch_array($queryuyo);

						$common = (time()-strtotime($rowuyo['addtime']));
                        $a = floor($common/86400/360); //整数年
                        $b = floor($common/86400/30) - $a*12; //整数月
                        $c = floor($common/86400) - $a*360 - $b*30; //整数日
                        $d = floor($common/86400); //总的天数
						
						
                          ?>
				
                <div  class="aui-list-box">
                    <div tapmode="" onclick="H.openWin('miquanshow', 'miquanshow.php?id=<?=$row['id']?>');"  class="aui-list-cell">
                        <div class="aui-cell-hd">
                            <img src="<?=$rowuyo['username']?>" alt="">
                        </div>
                        <div class="aui-cell-bd">
                            <h4><?=$rowuyo['shuyu']?></h4>
                            <p style="line-height: 0.5;font-size: 11px;">
                             Girl 13个月 23天
                            </p>
                        </div>
                        <span class="aui-cell-ft">
                            <i class="icon icon-time"></i>
                          <?=$row['timestamp']?>
                        
                        </span>
                    </div>
						<?php if($row['type']==2){ ?>
									<?php
			$sqlimg="SELECT show_pic FROM tbl_mother_article WHERE id= ".$row['id'];
			$rowimg= mysql_query($sqlimg);
			$rowall=mysql_fetch_array($rowimg);
			$imgeve =explode(",", $rowall['show_pic']);
		              ?>
					
					
                    <div tapmode="" onclick="H.openWin('miquanshow', 'miquanshow.php?id=<?=$row['id']?>');"  class="aui-list-image">
                        <div class="aui-list-well">
                            <div>
							
						<?php
						
						$ss = $row['pic_arr'];
   
  $sy=json_decode($ss, true);
 




						?>
                           
						      <img src="<?=$sy[0]['pic_url']?>" alt="">
                            </div>
                        </div>
                        <div class="aui-list-well-fot">
                            <div>
                                <img src="<?=$sy[1]['pic_url']?>" alt="">
                            </div>
                            <div>
                                <img src="<?=$sy[2]['pic_url']?>" alt="">
                            </div>
                        </div>
                    </div>
					
					  <?php } ?>
					  
						<?php if($row['type']==1){ ?>
						<?php
			$sqlimg="SELECT show_pic FROM tbl_mother_article WHERE id= ".$row['id'];
			$rowimg= mysql_query($sqlimg);
			$rowall=mysql_fetch_array($rowimg);
			$imgeve =explode(",", $rowall['show_pic']);
		              ?>
						
						
					
                        <div tapmode="" onclick="H.openWin('miquanshow', 'miquanshow.php?id=<?=$row['id']?>');" class="aui-list-well" style="background-image: url(<?=$imgeve[0]?>); position: relative; background-size: contain; background-size: cover; height: 177px;width: 100%">
                         <div style="color: white">
                        <!--------------<h3 style="margin-top:2px;">立秋的夜晚</h3>------------->
                       
                        </div>
                        </div>
					  <?php } ?>					  
					  
					  
	
                    <div class="aui-list-icon">
                        <div class="aui-list-icon-col">
 
						<?php
					    $sqluyo = "SELECT count(*) as b from tbl_mother_article_love  where article_id='".$row['id']."'  ";
                        $queryuyo=mysql_query($sqluyo);
                        $rowuyo=mysql_fetch_array($queryuyo);
						
					    $sqlcollect = "SELECT count(*) as c from tbl_mother_article_collect  where article_id='".$row['id']."' ";
                        $querycollect=mysql_query($sqlcollect);
                        $rowcollect=mysql_fetch_array($querycollect);	
						
					    $sqldianzan = "SELECT * from tbl_mother_article_love  where article_id='".$row['id']."' and uid='".$_COOKIE['userid']."' ";
                        $querydianzan=mysql_query($sqldianzan);
                        $rowdianzan=mysql_fetch_array($querydianzan);
						
						if($rowdianzan){
						$ifdianzan=1;
						}else {
						$ifdianzan=0;		
						}
						
						$sqlscang = "SELECT * from tbl_mother_article_collect  where article_id='".$row['id']."' and uid='".$_COOKIE['userid']."' ";
                        $queryscang=mysql_query($sqlscang);
                        $rowscang=mysql_fetch_array($queryscang);
						if($rowscang){
						$ifscang=1;
						}else {
						$ifscang=0;		
						}

                          ?>		
							
							
							<?php if($ifdianzan==1){ ?>
							
						<i onclick="zan(<?=$row['id']?>)" id="zan<?=$row['id']?>" class="icon icon-collection1"></i>
						
							  <?php } ?>
							  
							  
							<?php if($ifdianzan==0){ ?>
							
						<i onclick="zan(<?=$row['id']?>)" id="zan<?=$row['id']?>" class="icon icon-collection"></i>
						
							  <?php } ?>							  
							  
							  
							  
						<div id="dianzan<?=$row['id']?>" style="width: 49px;">	  
                          	 <?=$rowuyo['b']?>
						 </div>  
						<span id="isgg<?=$row['id']?>" style="display:none;"><?=$ifdianzan?></span>

                        </div>
                        <div class="aui-list-icon-col">
                            <i  class="icon icon-collection2"></i>
                            1

                        </div>						
						
						
						
                        <div class="aui-list-icon-rol" style="float:right;margin-right:17px;">
							<?php if($ifscang==1){ ?>
						
                            <i onclick="scang(<?=$row['id']?>)" id="scang<?=$row['id']?>" class="icon icon-comment2"></i>
							
							  <?php } ?>

							<?php if($ifscang==0){ ?>
						
                            <i onclick="scang(<?=$row['id']?>)" id="scang<?=$row['id']?>" class="icon icon-comment"></i>
							
							  <?php } ?>							  
							
                            <?=$rowcollect['c']?>
						
                          <span id="iscc<?=$row['id']?>" style="display:none;"><?=$ifscang?></span>
                        
                        </div>	
						
						
                    </div>					
					
                    <div tapmode="" onclick="H.openWin('miquanshow', 'miquanshow.php?id=<?=$row['id']?>');" class="aui-list-head">
				
                        <h3 style="margin-top:2px;">
						<?=$row['title']?>
						</h3>
						
                        <p style="margin-top:-10px;font-size: 13px;"> 
						<?php
						
						$s = $row['content'];
    $jsonStr = json_decode($s, true);
 
$content = '';
foreach($jsonStr as $i=>$item) {
  $n = $i + 1;
  $content .= "
$item[content]
";
}
echo $content;
						
						
						?>
						
						
						</p>
                        <!----------------
                        <div class="aui-list-head" style="padding: 0px 0px;font-size: 12px;">
                          <span style="color: #9e796d;"> #儿童餐#</span>
                          <span style="color: #9e796d;"> #儿童餐#</span>
                          <span style="color: #9e796d;"> #儿童餐#</span>
                          <span style="color: #9e796d;"> #儿童餐#</span>
                          <span style="color: #9e796d;"> #儿童餐#</span>

                        </div>
						-------------------->
                        <p style="margin-top:6px;font-size: 13px;"> <?=$row['city']?></p>                       
                    </div>					


                </div>
				
		
		<?php } ?>	
<div style="margin-top:10px;">  </div>
    <?php

    if($page==1){   
	if($page_count>$page){
		
	echo "<a href='?page=".$next."'  style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>下一页</a>&nbsp;&nbsp;&nbsp;";	
	
	}
   }else
    if($page==$page_count){
      echo "&nbsp;&nbsp;<a href='?page=".$last."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>上一页</a>&nbsp;&nbsp;&nbsp;";
    }else{
      echo "&nbsp;&nbsp;<a href='?page=".$last."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>上一页</a>&nbsp;&nbsp;&nbsp;";
      echo "<a href='?page=".$next."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>下一页</a>&nbsp;&nbsp;&nbsp;"; 
    }
  ?>		
				


                <!-- 结束 -->
   

    <div class="H-padding-vertical-bottom-10"></div>

    </div>
	<!-------结束-------->		
   <?include('footer.php');?>
	<script src="/ui/plugins/swiper/swiper.min.js"></script>	
    <script src="/ui/js/jquery-2.1.3.min.js"></script>
    <script src="/ui/script/H.js" type="text/javascript"></script>
	<script type="text/javascript" src="/ui/layer/mobile/layer.js"></script>  
	<script type="text/javascript">
        $(function () {  
            //防止页面后退  
            history.pushState(null, null, document.URL);  
            window.addEventListener('popstate', function () {  
                    history.pushState(null, null, document.URL);  
            });  
        }) 
   </script>
      <script type="text/javascript">
        var swiper = new Swiper('.swiper-container1', {
            pagination: '.swiper-pagination',
            onTouchStart: function (swiper, even) {
                H.setFrameAttr(H.frameName, null, { bounces: false });
            },
            onTouchEnd: function (swiper) {
                H.setFrameAttr(H.frameName, null, { bounces: true });
            }
        });
    </script>

	    <script type="text/javascript">
        var swiper = new Swiper('.swiper-container', {
            pagination: '.swiper-pagination1',
            onTouchStart: function (swiper, even) {
                H.setFrameAttr(H.frameName, null, { bounces: false });
            },
            onTouchEnd: function (swiper) {
                H.setFrameAttr(H.frameName, null, { bounces: true });
            }
        });
    </script>


	  
	    <script type="text/javascript">
        var swiper = new Swiper('.swiper-normal', {
            pagination: '.swiper-pagination',
            autoplay: 2500,
            loop: true
        });

    </script>
	    <script type="text/javascript">
        var swiper = new Swiper('.swiper-container', {
            pagination: '.swiper-pagination1',
            autoplay: 2000,
			direction:'vertical',
			  clickable: true,
            loop: true
        });

    </script>	
	
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
  wx.config({
    debug: false,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: '<?php echo $signPackage["timestamp"];?>',
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
    'checkJsApi', 'scanQRCode'// 所有要调用的 API 都要加到这个列表中
    ]
  });
  wx.ready(function () {

      wx.checkJsApi({
          jsApiList : ['scanQRCode'],
          success : function(res) {
              
          }
     });

      //点击按钮扫描二维码
      document.querySelector('#scanQRCode').onclick = function() {
          wx.scanQRCode({
              needResult : 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
              scanType : [ "qrCode"], // 可以指定扫二维码还是一维码，默认二者都有
              success : function(res) {
            	  var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
            
          	      window.location.href = result;//因为我这边是扫描后有个链接，然后跳转到该页面
              }
          });
      };
	    // 在这里调用 API
  });
</script>

<script>
         function zan(a){
        var article_id=a;
		var uid='<?=$_COOKIE['userid']?>';
		var dom22='zan'+article_id;
        var dom2 = document.getElementById(dom22);
        var dom23='dianzan'+article_id;
        var domzan=document.getElementById(dom23);
        domzan=domzan+1;
		if(uid==""){
            layer.open({
                     content: '即将带您去登录？'
                    ,btn: ['去登录', '取消']
                     ,yes: function(index){
                      window.location.href="mlogin.php"
                        layer.close(index);
                      }
                    });	
		return false;	
		}
		
		
		
			if ($("#isgg"+article_id).text() == '1' ) {
             $("#isgg"+article_id).text('0');
			     $.ajax({
        url: '/api/muyin/api.php?s=mother.cancel_article_love',
        type: 'POST',
        dataType: 'json',
        data: {uid: uid,
		article_id:article_id
		
		},
      })
      .done(function(respon) {
        if (respon.code==0) {
             layer.open({
    content: '取消关注成功'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
  
  
    $(dom2).removeClass('icon icon-collection1');
    $(dom2).addClass('icon icon-collection');
  	
  
  
  
        }else{
          
             layer.open({
    content: '操作太快!'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });		  
        
        }
      })
             } else {
            $("#isgg"+article_id).text('1');
			    $.ajax({
        url: '/api/muyin/api.php?s=mother.add_article_love',
        type: 'POST',
        dataType: 'json',
        data: {uid: uid,
		article_id:article_id
		
		},
      })
      .done(function(respon) {
        if (respon.code==0) {
             layer.open({
    content: '关注成功'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
      $(dom2).removeClass('icon-collection');
    $(dom2).addClass('icon-collection1');
  $("dianzan").append().domzan();
  
        }else{
         
layer.open({
    content: '操作太快!'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
		 
        
        }
      })		
     }  
		
	
	
	
}

</script>


<script>
         function scang(b){
        var article_id=b;
		var uid='<?=$_COOKIE['userid']?>';		
		var dom33='scang'+article_id;
        var dom3 = document.getElementById(dom33);
		
		if(uid==""){
            layer.open({
                     content: '即将带您去登录？'
                    ,btn: ['去登录', '取消']
                     ,yes: function(index){
                      window.location.href="mlogin.php"
                        layer.close(index);
                      }
                    });		
		return false;	
		}
		
		
		
			if ($("#iscc"+article_id).text() == '1' ) {
             $("#iscc"+article_id).text('0');
			     $.ajax({
        url: '/api/muyin/api.php?s=mother.cancel_article_collect',
        type: 'POST',
        dataType: 'json',
        data: {uid: uid,
		article_id:article_id
		
		},
      })
      .done(function(respon) {
        if (respon.code==0) {
             layer.open({
    content: '取消收藏'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
  
    $(dom3).removeClass('icon-comment2');
    $(dom3).addClass('icon-comment');
  
        }else{
          
             layer.open({
    content: '操作太快!'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });		  
        
        }
      })
             } else {
            $("#iscc"+article_id).text('1');
			    $.ajax({
        url: '/api/muyin/api.php?s=mother.add_article_collect',
        type: 'POST',
        dataType: 'json',
        data: {uid: uid,
		article_id:article_id
		
		},
      })
      .done(function(respon) {
        if (respon.code==0) {
             layer.open({
    content: '收藏成功'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
        $(dom3).removeClass('icon-comment');
    $(dom3).addClass('icon-comment2');
        }else{
         
layer.open({
    content: '操作太快!'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
		 
        
        }
      })		
     }  
		
	
	
	
}

</script>
  
</body>
</html>